Skip to main content

Create Feature Branches & Workflow Updates

This document outlines the steps for creating feature branches and updating GitHub workflows for streamlined deployment.

Pre-requisites

  1. Confirm the Base Branch: Ensure that you know the correct base branch from which the feature branches will be created. Typically, this is the develop branch.
  2. Confirm the Fix Version Name: Determine the fix version name you will be using for the branches and updates. This should be consistent across all steps.

Feature Branch

Naming Conventions

  • Feature branch format should be like feature-<fix-version-name>.
  • For a full-fledged feature, use chocolate names. For example: feature-mentos, feature-galaxy.
  • For a hot fix, use an Indian sweet name. For example: feature-boondhi, feature-imarti.

Note: *feature-** is a protected branch.

  • Two approvals are required to merge.
  • Only Vishwa or Vikram can merge to the *feature-* branch.

Steps to Create the Feature Branch

  1. Navigate to your repository on GitHub at DigitalInnk.
  2. On the main page of your repository, access the dropdown menu next to the branch selection.
  3. Choose the base branch if it's not already selected.
  4. Once the base branch is selected, click the branch dropdown menu again.
  5. Enter the name of your new branch (e.g., feature-mentos), then click "Create branch" or press Enter. This action will generate the new feature branch from the base branch.

Sprint Branch

A sprint branch is used as the base branch for a given sprint. All commits will be pushed to this sprint branch.

  • Sprint branch format should be like <sprint>-feature-<fix-version-name>. For example: sprint98-feature-mentos.
  • A new branch will be created at the beginning of each sprint.
  • sprint98-feature-* is a protected branch. You can only merge after two approvals.
  • This branch is created from its respective feature branch, in this case, feature-mentos.

Steps to Create the Sprint Branch

  1. Switch to the feature-<fix-version-name> branch by selecting it from the branch dropdown menu.
  2. After selecting the feature-<fix-version-name> branch, access the branch dropdown menu again.
  3. Input the name of your new branch (e.g., sprint97-feature-mentos), then click "Create branch" or press Enter. This process will create the new sprint feature branch from the feature-<fix-version-name> branch.

To Create a Callable Service, Follow These Steps

  1. Ensure that you have created fix version branches for the callable repository.
  2. Go to the "Actions" tab in the repository.
  3. Select the “.DEV - Deploy service for sprint branch” workflow.
  4. In the "Run workflow" dropdown menu, select the newly created branch <sprint>-feature-<new fix version> from the available branches, and manually run the workflow.
  5. Once the workflow execution is completed, open the workflow that you just ran.
  6. Inside the workflow run, look for the section related to the deployment of the callable service. Verify that the service name corresponds to the newly created callable service associated with the fix version branch <sprint>-feature-<new fix version>.
  7. Ensure that the service name is correctly listed and deployed in the Cloud Run Console.

Steps to Update GitHub Host Workflow for Web

  1. Open VS Code and switch to the <sprint>-feature-<fix-version-name> branch.
  2. Open the .firebaserc file.
    • Find the "targets" section within the JSON structure.
    • Remove the <old fix version name>-devvisn target and its associated array.
    • Add the <new fix version name>-devvisn target and its associated array.
  3. Open the firebase.json file.
    • Locate the section that defines the <old Fix Version>-devvisn target.
    • Replace the entire <old Fix Version>-devvisn target section with the updated <new fix version>-devvisn target.
    • Update the ServiceId associated with the callable service.
  4. Open the on_merge-sprint-feature_deploy_to_dev.yml file.
    • Locate the section where the branches are specified under the on key.
    • Update the branch name from sprint[0-9][0-9]-feature-<old Fix Version> to sprint[0-9][0-9]-feature-<new Fix Version>.
    • Locate the section where the Firebase hosting targets are set.
    • Update the Firebase hosting targets from <old Fix Version>-devvisn to <new Fix Version>-devvisn.

Steps to Update GitHub Host Workflow for Admin

  1. Open VS Code and switch to the <sprint>-feature-<fix-version-name> branch.
  2. Open the .firebaserc file.
    • Find the "targets" section within the JSON structure.
    • Remove the <old fix version name>-devadmin target and its associated array.
    • Add the <new fix version name>-devadmin target and its associated array.
  3. Open the firebase.json file.
    • Locate the section that defines the <old Fix Version>-devadmin target.
    • Replace the entire <old Fix Version>-devadmin target section with the updated <new fix version>-devadmin target.
    • Update the ServiceId associated with the callable service.
  4. Open the on_merge-sprint-feature_deploy_to_dev.yml file.
    • Locate the section where the branches are specified under the on key.
    • Update the branch name from sprint[0-9][0-9]-feature-<old Fix Version> to sprint[0-9][0-9]-feature-<new Fix Version>.
    • Locate the section where the Firebase hosting targets are set.
    • Update the Firebase hosting targets from <old Fix Version>-devadmin to <new Fix Version>-devadmin.

Verify Workflow and Hosting

  • After merging the PR, check GitHub Actions to ensure the merge workflow completes successfully.
  • In Firebase Console, verify the new hosting site is working.
note

Workflow updates are only necessary for the Web and Admin repositories. For other repositories, just creating the feature and sprint branches is sufficient.

Status: Accepted
Category: Protected
Authored By: Jeyakumar Arunagiri on May 24, 2024
Revisions.